package com.leetcode.链表;

public class test {
    public static void main(String[] args) {
        // 创建一个简单的链表 1 -> 2 -> 3
        ListNode head = new ListNode(1);
        head.next = new ListNode(2);
        head.next.next = new ListNode(3);

        ListNode A = head;
        ListNode B = head;

        // 输出 A、B 和 head 当前指向节点的值
        System.out.println("Before head = head.next:");
        System.out.println("A.val = " + A.val);
        System.out.println("B.val = " + B.val);
        System.out.println("head.val = " + head.val);

        head = head.next;

        // 输出 A、B 和 head 当前指向节点的值
        System.out.println("After head = head.next:");
        System.out.println("A.val = " + A.val);
        System.out.println("B.val = " + B.val);
        System.out.println("head.val = " + head.val);
    }

}
